package com.zhang.goods.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhang.goods.service.IAttrgroupService;
import com.zhang.goods.entity.Attrgroup;
import com.zhang.goods.mapper.AttrgroupMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 属性分组信息表 服务实现类
 * </p>
 *
 * @author 创世神
 * @since 2023-09-09
 */
@Service
public class AttrgroupServiceImpl extends ServiceImpl<AttrgroupMapper, Attrgroup> implements IAttrgroupService {


    @Override
    public List<Attrgroup> listByCategoryId(Long categoryId) {
        List<Attrgroup> list = list(new QueryWrapper<Attrgroup>().eq("category_id", categoryId));
        return list;
    }

    @Override
    public void modifyGroup(Attrgroup attrgroup) {
        updateById(attrgroup);
    }
}
